package com.ymttest.utils.compare;

import java.util.ArrayList;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

public class TaskFactory {
	public static <T> List<Runnable> generateTasks(List<T> paramList, Consumer<T> function){
		List<Runnable> runList = new ArrayList<>();
		paramList.forEach(param->runList.add(() -> function.accept(param)));
		return runList;
	}
	
	
	public static <T,V> List<Runnable> generateTasks(List<T> paramList, V param2,BiConsumer<T, V> function) {
		List<Runnable> runList = new ArrayList<>();
		paramList.forEach(param->runList.add(() -> function.accept(param,param2)));
		return runList;
	}
}
